package org.geometerplus.zlibrary.text.view;

import android.content.Context;

public final class ZLTextHorizontalDividerLineElement extends ZLTextElement {


	private final static int TOP_MARGIN = 80;
    private final static int DIVIDER_LINE_TOP_MARGIN = 30;
    private final static int DIVIDER_LINE_BOTTOM_MARGIN = 15;

	private static int TopMargin = -1, dividerTopMargin = -1, dividerBottomMargin = -1;
	public ZLTextHorizontalDividerLineElement()
	{

	}

	public int getHeight() {
		return mHeight;
	}
	public void setHeight(int height) {
		mHeight = height;
	}
	public static int getDividerLineTopMarginInPixel(Context ctx) {
		if(dividerTopMargin < 0)
		{
			final float scale = ctx.getResources().getDisplayMetrics().density;
			dividerTopMargin = (int) (DIVIDER_LINE_TOP_MARGIN * scale + 0.5f);
		}
		return dividerTopMargin;
		
	}
	public static int getDividerLineBottomMarginInPixel(Context ctx) {
        if (dividerBottomMargin < 0) {
			final float scale = ctx.getResources().getDisplayMetrics().density;
			dividerBottomMargin =  (int) (DIVIDER_LINE_BOTTOM_MARGIN * scale + 0.5f);
		}
		return dividerBottomMargin;
	}
	public static int getTopMarginInPixel(Context ctx) {
		if(TopMargin < 0)
		{
			final float scale = ctx.getResources().getDisplayMetrics().density;
			TopMargin = (int) (TOP_MARGIN * scale + 0.5f);
		}
		
		return TopMargin;
	}
	public void reset() {
		mHeight = -1;
	}

	private int mHeight = -1;
	

}
